import type { AxiosRequestConfig } from 'axios'
import type { ApiResult } from '@/types/app'
import type { RequestOptions } from '@/utils/http'
import type { GetDatabaseList, GetDownload, GetDownloadList, GetMaskTaskList,PostWatermark,GetDesensitization} from './type'
import { http } from '@/utils/http'

export const dmsMaskCenterApi = {
  /** 获取脱敏任务列表 */
  getMaskTaskList(config?: AxiosRequestConfig<GetMaskTaskList>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/dms-mask-center/api/v1/task/list', ...config }, options)
  },

  /** 获取数据库列表 */
  getDatabaseList(config?: AxiosRequestConfig<GetDatabaseList[]>, options?: RequestOptions) {
    return http.post<ApiResult<any>>({ url: '/dms-mask-center/api/v1/resource/database-list', ...config }, options)
  },

  /** 获取下载记录列表 */
  getDownloadList(config?: AxiosRequestConfig<GetDownloadList>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/dms-mask-center/api/v1/dataoffline/task/downloadRecord/page', ...config }, options)
  },

  /** 下载记录 */
  getDownload(config?: AxiosRequestConfig<GetDownload>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/dms-mask-center/api/v1/dataoffline/task/downloadRecord/watermark-file', ...config }, options)
  },
  
  /** 工具箱水印提交 */
  postWatermark(config?: AxiosRequestConfig<PostWatermark>, options?: RequestOptions) {
    return http.post<ApiResult<any>>({ url: '/dms-mask-center/api/v1/task', ...config }, options)
  },
  
  /** 工具箱溯源 */
  postTraceability(config?: AxiosRequestConfig<PostWatermark>, options?: RequestOptions) {
    return http.post<ApiResult<any>>({ url: '/dms-mask-center/api/v1/trace/file', ...config }, options)
  },
  /** 工具箱溯源列表 */
  postTraceabilityline(config?: AxiosRequestConfig<PostWatermark>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/dms-mask-center/api/v1/trace/file/list?page=0&size=15', ...config }, options)
  },

  /** 工具箱敏感数据 */
  postSensitive(config?: AxiosRequestConfig<PostWatermark>, options?: RequestOptions) {
    return http.post<ApiResult<any>>({ url: '/data-center/api/v1/data/find-task', ...config }, options)
  },
  /** 工具箱敏感数据列表 */
  postSensitiveline(config?: AxiosRequestConfig<PostWatermark>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/data-center/api/v1/res/classification/file?page=0&size=15', ...config }, options)
  },


  /** 获取脱敏策略 */
  getDesensitization(config?: AxiosRequestConfig<GetDesensitization>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/dms-mask-center/api/v1/classify/list', ...config }, options)
  },
  /** 敏感数据发现扫描规则 */
  getSensitive(config?: AxiosRequestConfig<GetDesensitization>, options?: RequestOptions) {
    return http.get<ApiResult<any>>({ url: '/data-center/api/v1/data/find-strategy?page=0&size=15&menuType=CRCS&noMask=true', ...config }, options)
  },
}
